Introduction to GitHub
Brief introduction using GitHub Desktop
Data Analytics Unit
Git
- Free and open source distributed version control system.
- Multiple features:
- Track changes to your files over time.
- Reliable and secure way to collaborate with multiple developers.
- Git allows you to work offline and then synchronize your changes when you’re connected.
- Stores your project’s history as a series of snapshots or commits.
- Enables branching and merging, allowing for parallel development and experimentation.
- It provides tools for resolving conflicts when multiple people modify the same file simultaneously.
Github
- Web-based platform that uses Git for version control.
- One of the largest online communities for developers.
- Complementary features:
- It provides a centralized location for hosting and collaborating on Git repositories.
- It offers a user-friendly interface to manage Git repositories and track changes.
- Introduces forks and pull requests.
- It provides features for issue tracking, project management, commenting, issues submission, and code review.
- GitHub Desktop available.
Repos
- A repository is a container that holds all the files, directories, and the history of changes for a project.
- Root folder of the project.
- How do we set up a repo?
- Fill the available options
![]()
- Clone the repo in your local machine using GitHub Desktop
![]()
Collaborating
- You can add collaborators to your project following these steps:
- Go to your repository’s website
- Click on the Settings tab
- Click on the Collaborators entry located on the left-side panel
- Authenticate yourself
- Click on the Add people button
- Search and add collaborators
Commiting and Pushing
- A commit saves a snapshot of your project’s state at a specific point in time.
- Commits are saved in the
git folder.
- You can restore your projects to a specific commit in time.
- Commits allow you to track and manage the process.
- A push is the action of sending your local commits to a remote repository (GitHub).
- How do we publish changes?
- Make sure your local version of the repository is updated by FETCHING any potential PULL.
![]()
- Select, unselect or ignore files from list and commit them.
![]()
- Publish branch (if it is first commit) or push them
![]()
Pulling changes
- Pull refers to the process of retrieving the latest changes from a remote repository and merging them into your local repository.
![]()
Conflicts
- Conflicts arise when simultaneous and not harmonious changes were made to the same part of a file by different branches or contributors.
- Conflicts are flagged using special characters (<<<<<<====>>>>>>)
- GitHub will not be able to publish or update your commit until you solve these conflicts.
- Always make sure of fetching BEFORE commiting!!!
- How can we handle them?